@import '../../style/themes/index.less';

@picker-prefix-cls: ~'@{prefix}-picker';
@picker__col-prefix-cls: ~'@{prefix}-picker__col';

.@{picker-prefix-cls} {
  &.disabled {
    .weui-item-bd {
      color: @disabled-color;
    }
  }

  .default-picker-item {
    // font-size: 34px;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
  }

  &-placeholder {
    color: @placeholder-color;
  }

  &-item {
    width: 100%;
  }

  &-panel {
    display: flex;
    position: relative;
    background-color: #fff;
    overflow: hidden;
    user-select: none;
    height: 480px;
    -webkit-user-select: none;
    scroll-behavior: 'unset';
    -webkit-overflow-scrolling: none;
  }

  &__col {
    flex: 1;
    position: relative;
    height: 100%;
    font-size: 32px;
    touch-action: none;

    &:last-child .@{picker-prefix-cls}__item {
      padding-right: constant(safe-area-inset-right);
      padding-right: env(safe-area-inset-right);
    }
    &:first-child .@{picker-prefix-cls}__item {
      padding-left: constant(safe-area-inset-left);
      padding-left: env(safe-area-inset-left);
    }
  }

  &__mask {
    top: 0;
    height: 100%;
    margin: 0 auto;
    background: -webkit-linear-gradient(top, hsla(0, 0%, 100%, 0.95), hsla(0, 0%, 100%, 0.6)),
      -webkit-linear-gradient(bottom, hsla(0, 0%, 100%, 0.95), hsla(0, 0%, 100%, 0.6));
    background: linear-gradient(180deg, hsla(0, 0%, 100%, 0.95), hsla(0, 0%, 100%, 0.6)),
      linear-gradient(0deg, hsla(0, 0%, 100%, 0.95), hsla(0, 0%, 100%, 0.6));
    background-position: top, bottom;
    background-size: 100% 184px;
    background-repeat: no-repeat;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    pointer-events: none;
  }

  &__indicator {
    height: 112px;
    top: 184px;

    &:after,
    &:before {
      content: ' ';
      position: absolute;
      left: 0;
      right: 0;
      height: 2px;
      color: rgba(0, 0, 0, 0.1);
    }

    &:before {
      top: 0;
      border-top: 2px solid rgba(0, 0, 0, 0.1);
      -webkit-transform-origin: 0 0;
      transform-origin: 0 0;
      -webkit-transform: scaleY(0.5);
      transform: scaleY(0.5);
    }

    &:after {
      bottom: 0;
      border-bottom: 2px solid rgba(0, 0, 0, 0.1);
      -webkit-transform-origin: 0 100%;
      transform-origin: 0 100%;
      -webkit-transform: scaleY(0.5);
      transform: scaleY(0.5);
    }
  }

  &__content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
  }

  &__item {
    height: 96px;
    line-height: 96px;
    text-align: center;
    color: rgba(0, 0, 0, 0.9);
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
  }

  &__disabled {
    color: rgba(0, 0, 0, 0.5);
  }

  &__indicator,
  &__mask {
    position: absolute;
    left: 0;
    width: 100%;
    z-index: 3;
  }
}
